<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Job Search</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/simple-line-icons.css">
<link rel="stylesheet" href="css/animate.css">
<link href="../css/searchjob.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="fullsize/jquery.js"></script>
<script type="text/javascript" src="fullsize/jquery.fullsize.minified.js"></script>       
<script src="/../vendor/Mustache/mustache.js-master/mustache.js"></script>    <!-- global -->
<script language="javascript" type="text/javascript">

function clearText(field)
{
	if (field.defaultValue == field.value) field.value = '';
	else if (field.value == '') field.value = field.defaultValue;	
}
//$(function(){
//				$("div.templatemo_gallery img").fullsize();
//			});
</script>
<?php

include __DIR__ ."../../PHP/db.php";

if ($_SESSION['login'] == NULL)
{
 header("Location: ../index.php");	
}
else
{
$login = $_SESSION['login'];

$userid = mysql_query("SELECT * FROM `flss`.`accounts` WHERE `user` = '$login'");
while($rowshow = mysql_fetch_array($userid))
{
	$getid = $rowshow['account_id'];
}

$getresume = mysql_query("SELECT * FROM `flss`.`applicant` WHERE `applicant_id` = '$getid'");
while($rowdate = mysql_fetch_array($getresume))
{
	$getdateofupdate = $rowdate['Resume_Updated'];
}

if(!$getdateofupdate)
	{
	   header("Location:start.php");
	}

		
//get employers job and details
$getall = mysql_query("SELECT * FROM `flss`.`job_order` ") or die(mysql_error);
$getaname = mysql_query("SELECT * FROM `flss`.`applicant` WHERE `applicant_id` = '$getid'") or die(mysql_error());
$getaaddress = mysql_query("SELECT * FROM `flss`.`a_address` WHERE `applicant_id` = '$getid'") or die(mysql_error());
$getaheight = mysql_query("SELECT * FROM `flss`.`applicant` WHERE `applicant_id` = '$getid'") or die(mysql_error());
$getaweight = mysql_query("SELECT * FROM `flss`.`applicant` WHERE `applicant_id` = '$getid'") or die(mysql_error());
$getnationality = mysql_query("SELECT * FROM `flss`.`applicant` WHERE `applicant_id` = '$getid'") or die(mysql_error());

}
?>

<style type="text/css">
	#tfheader{
		background-color:#c3dfef;
	}
	#tfnewsearch{
		float:right;
		padding:20px;
	}
	.tftextinput{
		margin: 0;
		padding: 5px 15px;
		font-family: Arial, Helvetica, sans-serif;
		font-size:14px;
		border:1px solid #0076a3; border-right:0px;
		border-top-left-radius: 5px 5px;
		border-bottom-left-radius: 5px 5px;
	}
	.tfbutton {
		margin: 0;
		padding: 5px 15px;
		font-family: Arial, Helvetica, sans-serif;
		font-size:14px;
		outline: none;
		cursor: pointer;
		text-align: center;
		text-decoration: none;
		color: #ffffff;
		border: solid 1px #0076a3; border-right:0px;
		background: #0095cd;
		background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
		background: -moz-linear-gradient(top,  #00adee,  #0078a5);
		border-top-right-radius: 5px 5px;
		border-bottom-right-radius: 5px 5px;
	}
	.tfbutton:hover {
		text-decoration: none;
		background: #007ead;
		background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
		background: -moz-linear-gradient(top,  #0095cc,  #00678e);
	}
	/* Fixes submit button height problem in Firefox */
	.tfbutton::-moz-focus-inner {
	  border: 0;
	}
	.tfclear{
		clear:both;
	}
</style>

</head>
<body>

<?php
 include __DIR__ . "/../php/headerapp.php";

?>
 
<div class="search-container" style="position:relative; margin-top:70px; margin-left: 222px; margin-right: 200px;">
	<div id="tfheader">
		<form id="tfnewsearch" method="get" action="">
		        <input type="text" placeholder="Keywords, Title, Categories, Subcategories" class="tftextinput" name="qwertyuiop" size="100" maxlength="120"><input type="submit" value="search" class="tfbutton">
		</form>
	<div class="tfclear"></div>
</div>
	<div class="search-header" style="margin-top:30px;">
		<h4><center>Job Search Query</center></h4>
		<hr><hr>
	</div>
	<div>
		<table width=100%>
			<tr>
			<th>Job title</th>
			<th>Company</th>
			<th>Applicant Needed</th>
			<th>Minimum Yrs Experience</th>
			<th>Date Posted</th>
			</tr>
            <?php 
			$keyword = $_GET['qwertyuiop'];
			$getalljobs = mysql_query("SELECT em.ename as name, jo.Title as title, jo.numapps as numb, jo.date_posted as date, jo.Job_mined as educ, jo.refid as refid, jo.job_id as id
			FROM job_order jo
			LEFT JOIN employer em on em.employer_id = jo.employer_id
			WHERE (jo.Title LIKE '%$keyword%' OR jo.Job_category LIKE '%$keyword%' OR jo.Job_sub LIKE '%$keyword%') AND  jo.status = '1'
			") or die(mysql_error());

			while($rowapp = mysql_fetch_array($getalljobs)) { 
			?>
			<tr id="id_<?=$rowapp['id']?>">
				<td width="30%"><a style="cursor:pointer;" href="../Employer/Job/joborder.php?refid=<?=$rowapp['refid']?>" onClick="window.open(this.href,'popupwindow','left=200,top=50,width=1000,height=600,scrollbars=yes,menu=0,status=0'); return false;"> 
                				<?=$rowapp['title']?>
                                </a>
                </td>
				<td width="20%"><?=$rowapp['name']?></td>
				<td width="10%"><?=$rowapp['numb']?></td>
				<td width="15%" align="left"><?=$rowapp['educ']?></td>
				<td width="20%"><?=$rowapp['date']?></td>
			</tr>
            <tr>
            <td width="20%;">
            <hr style="border-top:dotted 1px;">
            </td>
            <td width="10%;">
            <hr style="border-top:dotted 1px;">
            </td>
            <td width="20%;">
            <hr style="border-top:dotted 1px;">
            </td>
            <td width="20%;">
            <hr style="border-top:dotted 1px;">
            </td>
            <td width="100%;">
            <hr style="border-top:dotted 1px;">
            </td>
            </tr>

			
            <?php } ?>
		</table>

	</div>
</div>


<?php
 include __DIR__ . "/../php/footer.php";

?>



</body>
</html>